//video_article_see
exports.video_article_see = function (req, res) {

    //获取restful参数
    var restfulParams = req.routeInfo.restfulParams;
    //最终结果
    var resultData = {};

    var browseCount = 0;

    //任务流创建
    async.waterfall([

        //获取视频观看详情
        function (cb) {

            R.SEND_HTTP(
                req,
                {
                    url: CORE_APIConfig.coreAPI.search_content + "/fc_id/" + restfulParams.fc_id,
                    method: 'POST',
                    data: {
                        fields: ["fc_id", "fc_browse_count"].join(",")
                    }

                },
                function (err, data) {

                    resultData.browseCount = data.data;

                    browseCount = data.data;
                    cb();
                }
            );
        },
        //更新视频观看次数
        function (cb) {
            if (browseCount.length > 0) {
                R.SEND_HTTP(
                    req,
                    {
                        url: CORE_APIConfig.coreAPI.updateForumContent,
                        method: 'POST',
                        data: {
                            fc_id: restfulParams.fc_id,
                            fc_browse_count: parseInt(browseCount[0].fc_browse_count) + 1
                        }

                    },
                    function (err, data) {

                        resultData.updateData = data.data;
                        cb();
                    }
                );
            } else {
                resultData.failReason = "Video has not found";
            }

        },
    ], function (err, result) {

        //返回最终拼接结果
        RES.response(res, true, resultData);

    });

};